package com.base.cn.platform.os.service.manage.user.sms;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 用户发送短信接口
 *
 * @author s.li
 * @create 2018-06-04-14:04
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface UserSendSmsService extends BaseService {

    /**
     * 发送手机短信验证码
     * @param mobile 手机号
     * @param status  类型，1注册，找回，3绑定，4更换，5完善资料
     * @param sessionId  完善资料时需要传入
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/user/sendMobileCode")
    Map<String,Object> sendMobileCode(@RequestParam("mobile") String mobile,
                                      @RequestParam("status") int status,
                                      @RequestParam(value = "sessionId", required = false) String sessionId);

    /**
     * 发送邮箱验证码
     * @param email 邮箱号
     * @param status 1=注册，2=找回密码，3=绑定邮箱号（用于验证新绑定的邮箱号），4=改绑邮箱号（用于验证原绑定的邮箱号）
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/user/sendEmailCode")
    Map<String,Object> sendEmailCode(@RequestParam("email") String email,
                                     @RequestParam("status") int status);
}
